str = input("请输入一串字符串：")
def reverse (str):
    if str == '' or len(str) == 1:
        revstr = str
    else:
        revstr = str[-1] + reverse(str[0:len(str)-1])
    return revstr
print ( reverse ( str ) )
